home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-04-08 | 21.1 KB | 569 lines | [TEXT/CCL2] |
- #|
- menus.lisp
-
- Defines the menubar, menus, menu-items and their behavior used in the
- Mini-Application sample program.
-
- For further info, see files "About Mini-App" and "Instructions".
-
-
- Copyright 1990, 1991 by Ruben Kleiman for Apple Computer, Inc.
-
- Change History.
- 03-12-92 slm Rearranged lexical order of Options menu menu-items to better
- match the actual order in the menu.
- 03-10-92 slm The menu-item-action method for create-by-rectangle-menu-item
- ignores palettes.
- 03-09-92 slm Updated file header comments.
- 03-08-92 slm In new-menu-item-action, added ":color-p *color-available*"
- to "make-instance 'draw-dialog" as changed the class of
- of draw-dialog from color-dialog to dialog.
- 03-07-92 slm Cut, Copy, Paste and Clear changed to window-menu-items
- to specialize them for draw-dialogs.
- The clear menu-item-action was also changed to cope when
- there's no draw-dialog and to only operate on the front window.
- 01-19-92 slm Added: (message-dialog "Never implemented!") (6x)
- 01-17-92 slm (front-window 'draw-dialog) ->
- (front-window :class 'draw-dialog) (2x)
-
- |#
-
- ;;; ______________________________________________________________________________________
- ;;; Define menus
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; *mini-application-file-menu*
- ;;;
- ;;; This will be our FILE menu. Its menu items are defined further down.
- ;;;
- (setq *mini-application-file-menu*
- (make-instance 'menu
- :menu-title "File"))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; *mini-application-edit-menu*
- ;;;
- ;;; This will be our EDIT menu. Its menu items are defined further down.
- ;;;
- (setq *mini-application-edit-menu*
- (make-instance 'menu
- :menu-title "Edit"))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; *mini-application-options-menu*
- ;;;
- ;;; This will be our OPTIONS menu. Its menu items are defined further down.
- ;;;
- (setq *mini-application-options-menu*
- (make-instance 'menu
- :menu-title "Options"))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; *selected-object-menu-indicator*
- ;;;
- ;;; This menu will be displayed whenever an object is selected in the frontmost
- ;;; draw-dialog window. The menu's name will be the name of the object.
- ;;;
- (setq *selected-object-menu-indicator*
- (make-instance 'menu
- :menu-title ""))
-
- ;;; _____________________________________________________________________________________
- ;;; Define menubar
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; *mini-application-menubar*
- ;;;
- ;;; This is our menubar. It is a list of the menus created above.
- ;;; The menus haven't yet been assigned menu items: this is done further down.
- ;;;
- (setq *mini-application-menubar*
- (list *mini-application-file-menu*
- *mini-application-edit-menu*
- *mini-application-options-menu*
- *windows-menu* ; We will borrow the convenient MCL WINDOWS menu
- *selected-object-menu-indicator*))
-
- ;;; _____________________________________________________________________________________
- ;;; Define all of the menu items
-
- ;;; __________________________________
- ;;; Define FILE menu items:
-
- ;;; _____________________
- ;;; FILE NEW menu item.
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; *file-new-menu-item*
- ;;;
- ;;; This is the FILE menu's NEW menu item. When selected, this menu item calls the function
- ;;; NEW-MENU-ITEM-ACTION, which creates a new window (an instance of our class DRAW-DIALOG).
- ;;;
- (setq *file-new-menu-item*
- (make-instance 'menu-item
- :menu-item-title "New"
- :command-key #\N
- :menu-item-action 'new-menu-item-action))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; new-menu-item-action
- ;;;
- ;;; Called by the File menu New menu item. Creates a new window.
- ;;;
- (defun new-menu-item-action ()
- (make-instance 'draw-dialog
- :window-title (format nil "Draw Dialog ~a" (incf *window-count*))
- :view-size #@(300 300)
- :view-position (make-point 5 40)
- :color-p *color-available*
- :window-type :document-with-zoom))
-
- ;;; ______________________
- ;;; FILE CLOSE menu item
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; *file-close-menu-item*
- ;;;
- ;;; This is the FILE menu's CLOSE menu item. When selected, this menu item calls the
- ;;; function CLOSE-MENU-ITEM-ACTION, which closes ANY type of window in the front.
- ;;;
- (setq *file-close-menu-item*
- (make-instance 'menu-item
- :menu-item-title "Close"
- :command-key #\W
- :menu-item-action 'close-menu-item-action))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; close-menu-item-action
- ;;;
- ;;; Called by the FILE menu CLOSE menu item. Closes frontmost window.
- ;;;
- (defun close-menu-item-action ()
- (window-close (front-window)))
-
- ;;; ______________________
- ;;; FILE QUIT menu item
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; *file-quit-menu-item*
- ;;;
- ;;; This is the FILE menu's QUIT menu item. When selected, this menu item calls the
- ;;; function QUIT-MENU-ITEM-ACTION, which quits our application and returns to MCL.
- ;;;
- (setq *file-quit-menu-item*
- (make-instance 'menu-item
- :menu-item-title "Quit"
- :command-key #\Q
- :menu-item-action 'quit-menu-item-action))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; quit-menu-item-action
- ;;;
- ;;; Called by the FILE menu QUIT menu item. Goes back to MCL.
- ;;;
- (defun quit-menu-item-action ()
- (set-menubar *default-menubar*)) ; The *default-menubar* is MCL's menubar.
-
-
- ;;; ______________________
- ;;; Install the FILE menu items into the FILE menu
- ;;;
-
- (add-menu-items *mini-application-file-menu*
- *file-new-menu-item*
- *file-close-menu-item*
- *file-quit-menu-item*)
-
-
- ;;; ________________________________________
- ;;; Define EDIT menu items
-
-
- ;;; _____________________
- ;;; EDIT CUT menu item
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; *cut-menu-item*
- ;;;
- ;;; This is the EDIT menu's CUT menu item. When selected, this menu cuts the selected
- ;;; object, if any, in the frontmost drawing window.
- ;;;
- (setq *cut-menu-item*
- (make-instance 'window-menu-item
- :menu-item-title "Cut"
- ; :disabled t more complicated to deal with
- :command-key #\X
- :menu-item-action 'cut))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; cut menu-item-action
- ;;;
- ;;; Called by EDIT menu's CUT menu item. Left as an
- ;;; exercise to the reader!
- ;;;
- (defmethod cut ((w draw-dialog))
- (ed-beep)
- (message-dialog "Never implemented!"))
-
- ;;; _____________________
- ;;; EDIT COPY menu item
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; *copy-menu-item*
- ;;;
- ;;; This is the EDIT menu's COPY menu item. When selected, this menu copies the
- ;;; selected object, if any, in the frontmost drawing window.
- ;;;
- (setq *copy-menu-item*
- (make-instance 'window-menu-item
- :menu-item-title "Copy"
- ; :disabled t more complicated to deal with
- :command-key #\C
- :menu-item-action 'copy))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; copy menu-item-action
- ;;;
- ;;; Called by EDIT's COPY menu item. Left as an exercise
- ;;; to the reader!
- ;;;
- (defmethod copy ((w draw-dialog))
- (ed-beep)
- (message-dialog "Never implemented!"))
-
- ;;; _____________________
- ;;; EDIT PASTE menu item
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; *paste-menu-item*
- ;;;
- ;;; This is the EDIT menu's PASTE menu item. When selected, this menu pastes the
- ;;; last copied object, if any, into the frontmost drawing window.
- ;;;
- (setq *paste-menu-item*
- (make-instance 'window-menu-item
- :menu-item-title "Paste"
- :command-key #\V
- :menu-item-action 'paste))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; paste menu-item-action
- ;;;
- ;;; Called by EDIT's PASTE menu item. Left as an exercise
- ;;; to the reader!
- ;;;
- (defmethod paste ((w draw-dialog))
- (ed-beep)
- (message-dialog "Never implemented!"))
-
- ;;; ______________________
- ;;; EDIT CLEAR menu item
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; *clear-menu-item*
- ;;;
- ;;; This is the EDIT menu's CLEAR menu item. When selected, this menu clears the
- ;;; selected object, if any, in the frontmost drawing window.
- ;;;
- (setq *clear-menu-item*
- (make-instance 'window-menu-item
- :menu-item-title "Clear"
- ; :disabled t more complicated to deal with
- :menu-item-action 'clear))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; clear menu-item-action
- ;;;
- ;;; Called by EDIT menu's CLEAR menu item.
- ;;;
- (defmethod clear ((window draw-dialog))
- (when (neq (type-of window) 'palette) ; Make sure that it isn't a palette
- (dolist (item (slot-value window 'selections)) ; Look through selection(s)
- (remove-subviews window item) ; Remove selection from window
- (dispose-record (slot-value item 'rectangle) :rect)) ; Dispose draw-item rectangle
- (view-draw-contents window))) ; Redraw the window to get rid of obsoleted draw-item items
-
- ;;; ______________________
- ;;; Install the EDIT menu items into the EDIT menu.
- ;;;
- (add-menu-items *mini-application-edit-menu*
- *cut-menu-item*
- *copy-menu-item*
- *paste-menu-item*
- *clear-menu-item*)
-
-
- ;;; ________________________________________
- ;;; Define the OPTIONS menu items:
-
- ;;; _____________________________________
- ;;; OPTIONS menu's PALETTE menu item
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; *palette-menu-item*
- ;;;
- ;;; This is the OPTIONS menu's PALETTE menu item. When selected, it will call
- ;;; PALETTE-MENU-ITEM, which will show the palette if it is hidden, else it
- ;;; will hide the palette.
- ;;;
- (setq *palette-menu-item*
- (make-instance 'menu-item
- :menu-item-title "Palette"
- :menu-item-action 'palette-menu-item))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; palette-menu-item
- ;;;
- ;;; This is called when the Options menu's Palette menu item is selected
- ;;; We want to enable the Palette menu item when the palette is displayed.
- ;;; Also, if there is no palette and the user selects this item, then
- ;;; we want to show it; else we want to hide (not close) it.
- ;;;
- (defun palette-menu-item ()
- (let ((palette-shown (menu-item-enabled-p *palette-menu-item*))
- (palette (car (windows :class 'palette))))
- (if (and palette-shown
- palette)
- (window-close palette) ;; there is a defined method for palettes!
- (show-palette))
- (menu-item-disable *palette-menu-item*)))
-
- ;;; ___________________________________
- ;;; OPTIONS menu WINDOW INFO menu item
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; *window-object-info-menu-item*
- ;;;
- ;;; This is the OPTIONS menu's WINDOW INFO menu item. When selected, this menu item calls
- ;;; SHOW-WINDOW-INFO, which will let the user show information about
- ;;; the frontmost drawing window.
- ;;;
- (setq *window-object-info-menu-item*
- (make-instance 'menu-item
- :disabled t
- :menu-item-title "Window Info..."
- :menu-item-action 'show-window-info))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; show-window-info
- ;;;
- ;;; Called by the OPTIONS menu's WINDOW INFO menu item.
- ;;; Shows information about the frontmost window, if it is a draw-dialog window.
- ;;;
- (defun show-window-info ()
- (ed-beep)
- (message-dialog "Never implemented!"))
-
- ;;; _____________________________________
- ;;; OPTIONS menu WINDOW SCRIPT menu item
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; *window-script-menu-item*
- ;;;
- ;;; This is the OPTIONS menu's WINDOW SCRIPT menu item. When selected, this menu item calls
- ;;; EDIT-WINDOW-SCRIPT, which will let the user edit the script for
- ;;; the frontmost drawing window.
- ;;;
- (setq *window-script-menu-item*
- (make-instance 'menu-item
- :menu-item-title "Window Script..."
- :disabled t
- :menu-item-action 'edit-window-script))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; edit-window-script
- ;;;
- ;;; Called by the OPTIONS menu's WINDOW SCRIPT menu item.
- ;;;
- (defun edit-window-script ()
- (ed-beep)
- (message-dialog "Never implemented!"))
-
- ;;; ________________________________
- ;;; OBJECT INFO menu item
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; *object-info-menu-item*
- ;;;
- ;;; This is the OPTIONS menu's OBJECT INFO menu item. When selected, this menu item calls
- ;;; SHOW-OBJECT-INFO, which will try to display a dialog box with information about
- ;;; the currently selected object(s) in the frontmost drawing window.
- ;;;
- (setq *object-info-menu-item*
- (make-instance 'menu-item
- :menu-item-title "Object Info..."
- :disabled t
- :command-key #\I
- :menu-item-action 'show-object-info))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; show-object-info
- ;;;
- ;;; This gets called whenever we wish to obtain the information boxes
- ;;; for one or more objects. If the objects are not supplied, then
- ;;; look at the objects selected in the frontmost DRAW-DIALOG class window.
- ;;; This function can be called by the Object Info...
- ;;; menu item, or by the author-mode-double-click-handler generic function.
- ;;;
- (defun show-object-info (&rest objects)
- (if objects
- ;; Show an information box for each object
- (dolist (object objects)
- ;; the method show-info does the real work:
- (show-info object))
- ;; Show an information box for each selected object in the frontmost window
- (let ((draw-windows (windows :class 'draw-window)))
- (if (and draw-windows
- (slot-value (first draw-windows) 'selections))
- (show-object-info (slot-value (first draw-windows) 'selections))))))
-
- ;;; _____________________________________
- ;;; OPTIONS menu OBJECT SCRIPT menu item
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; *object-script-menu-item*
- ;;;
- ;;; This is the OPTIONS menu's OBJECT SCRIPT menu item. When selected, this menu item calls
- ;;; EDIT-OBJECT-SCRIPT, which will let the user edit the script for
- ;;; the currently selected object(s) in the frontmost drawing window.
- ;;;
- (setq *object-script-menu-item*
- (make-instance 'menu-item
- :menu-item-title "Object Script..."
- :disabled t
- :menu-item-action 'edit-object-script))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; edit-object-script
- ;;;
- ;;; Called by OPTIONS menu's OBJECT SCRIPT menu item.
- ;;; If given an object argument, will allow editing of the object's script.
- ;;; Else, it will look at the selected object, if any, in the frontmost
- ;;; draw window and allow editing of its script.
- ;;;
- (defun edit-object-script (&optional object)
- (declare (ignore object))
- (ed-beep)
- (message-dialog "Never implemented!"))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; *bring-to-front-menu-item*
- ;;;
- ;;; This is the OPTION menu's BRING TO FRONT menu item. When selected, this menu item
- ;;; calls BRING-OBJECT-TO-FRONT, which will bring the currently selected object
- ;;; in the frontmost draw-dialog window to the front of the window.
- ;;;
- (setq *bring-to-front-menu-item*
- (make-instance 'menu-item
- :menu-item-title "Selection To Front"
- :menu-item-action 'bring-selection-to-front))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; bring-selection-to-front
- ;;;
- ;;; Called by the OPTIONS menu's SELECTION TO FRONT menu item.
- ;;; Tells the window to do it.
- ;;;
- (defun bring-selection-to-front ()
- (let ((draw-window (car (windows :class 'draw-dialog))))
- (and draw-window
- (bring-item-to-front draw-window))))
-
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; create-by-rectangle-menu-item
- ;;;
- ;;; A subclass of MENU-ITEM whose action is to allow or disallow
- ;;; creation of object by dragging out a rectangle in the frontmost
- ;;; draw-dialog window.
- ;;;
- (defclass create-by-rectangle-menu-item (menu-item) ())
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; *create-by-rectangle-menu-item*
- ;;;
- ;;; This is the OPTION menu's CREATE BY RECTANGLE menu item. When selected,
- ;;; this menu item will allow or discontinue creation of objects on draw-dialogs
- ;;; by selecting and dragging out a rectangle on the window. It has no other
- ;;; purpose.
- ;;;
- (setq *create-by-rectangle-menu-item*
- (make-instance 'create-by-rectangle-menu-item
- :menu-item-title "Create By Rectangle"))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; menu-item-action [create-by-rectangle-menu-item]
- ;;;
- ;;; This gets called whenever the "Create By Rectangle" menu item is selected
- ;;; by the user. The action is to check or uncheck the menu item and
- ;;; to set the create-by-rectangle mode of the draw-dialog window in the front.
- ;;;
- (defmethod menu-item-action ((item create-by-rectangle-menu-item))
- (let ((draw-dialog-window (front-window :class 'draw-dialog)))
- (when (and draw-dialog-window
- (neq (type-of draw-dialog-window) 'palette)) ; Make sure that it isn't a palette
- (set-menu-item-check-mark item (not (menu-item-check-mark item)))
- (setf (slot-value draw-dialog-window 'create-by-rectangle)
- (not (slot-value draw-dialog-window 'create-by-rectangle))))))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; *go-to-lisp-menubar-menu-item*
- ;;;
- ;;; This is the OPTION menu's GO TO LISP MENUBAR menu item. When selected, it
- ;;; will change the menubar to the regular Lisp menubar.
- ;;;
- (setq *go-to-lisp-menubar-menu-item*
- (make-instance 'menu-item
- :menu-item-title "Go To Lisp Menubar"
- :menu-item-action #'(lambda ()
- (set-menubar *default-menubar*))))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; *mini-application-options-menu*
- ;;;
- ;;; Install the Option menu items into the Options menu:
- ;;;
- (add-menu-items *mini-application-options-menu*
- *palette-menu-item*
- (make-instance 'menu-item :menu-item-title "-") ; Dividing line
- *window-object-info-menu-item*
- *window-script-menu-item*
- (make-instance 'menu-item :menu-item-title "-")
- *object-script-menu-item*
- *object-info-menu-item*
- *bring-to-front-menu-item*
- *create-by-rectangle-menu-item*
- (make-instance 'menu-item :menu-item-title "-")
- *go-to-lisp-menubar-menu-item*)
-
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; *tools-menu*
- ;;;
- ;;; We add a menu item to the end of the Lisp TOOLS menu which will allow
- ;;; us to go back to our mini-application from the Lisp menubar.
- ;;; This facilitates switching back and forth between the two environments.
- ;;;
- (add-menu-items *tools-menu*
- (make-instance 'menu-item :menu-item-title "-") ; A menu item divider line
- (make-instance 'menu-item
- :menu-item-title "Go To Mini-Application"
- :menu-item-action #'(lambda ()
- (set-menubar *mini-application-menubar*))))
-
-
- ;;; _______________________________________________________________________________________
- ;;; Menu Initialization
- ;;;
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; show-menus
- ;;;
- ;;; This gets called when our application starts up
- ;;;
- (defun show-menus ()
- (set-menubar *mini-application-menubar*))
-
- ;end of file menus.lisp
- ;------------------------------------------------
-